<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
<!-- Loading Bootstrap -->
<link href="./Public/Admin/Flat/dist/css/vendor/bootstrap.min.css" rel="stylesheet">
<!-- Loading Flat UI -->
<link href="./Public/Admin/Flat/dist/css/flat-ui.css" rel="stylesheet">
<link href="./Public/Admin/Flat/docs/assets/css/demo.css" rel="stylesheet">
<link rel="shortcut icon" href="./Public/Admin/Flat/img/favicon.ico">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
<script src="dist/js/vendor/html5shiv.js"></script>
<script src="dist/js/vendor/respond.min.js"></script>
<![endif]-->
</head>
<body>
<form action="" method="post">
	<table class="table table-hover">
		<tr>
			<td>货品ID</td>
			<?php foreach ($data as $v){?>
			  	<td><?php echo $v['taname']?></td>
			<?php }?>
			<td>库存</td>
			<td>货号</td>
			<td>操作</td>
		</tr>
			
		<?php foreach ($listData as $v){?>
		<tr>
			<td><?php echo $v['glid']?></td>
			<?php foreach ($v['combine'] as $value){?>
				<td><?php echo $value?></td>
			<?php }?>
			<td><?php echo $v['inventory']?></td>
			<td><?php echo $v['number']?></td>
			<td>						
				<a href="<?php echo U('GoodsList/edit',array('glid'=>$v['glid'],'gid'=>$_GET['gid']))?>" class="btn btn-sm btn-warning">修改</a>
				<a href="javascript:if(confirm('确定删除吗？')) location.href='<?php echo U('GoodsList/del',array('glid'=>$v['glid']))?>'" class="btn btn-sm btn-danger">删除</a>
			</td>
		</tr>
		<?php }?>
		
		<tr>
			<td>添加货品</td>
			<?php foreach ($data as $v){?>
			<td>
				<select name="combine[]">
					<option value="">请选择</option>
					<?php foreach ($v['value'] as $value){?>
						<option value="<?php echo $value['gtid']?>"><?php echo $value['gtvalue']?></option>
					<?php }?>
				</select>
			</td>
			<?php }?>
			<td><input type="text" name="inventory" id=""></td>
	        <td><input type="text" name="number" id=""></td>
	        <td><button class="btn btn-sm btn-warning">确认添加</button></td>
		</tr>
			
		</table>
	</form>
	</body>
</html>
